﻿using System;
using System.ComponentModel;
using System.Linq.Expressions;
using VisualWip.Core.Utils;

namespace VisualWip.TFS2010PersistanceProvider
{
    public class TFSConnectionSettingsPathView : INotifyPropertyChanged
    {
        private bool _isSelected;
        public string Name { get; set; }

        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                if (value != _isSelected)
                {
                    _isSelected = value;
                    OnPropertyChanged(this, () => IsSelected);
                }
            }
        }

        #region Implementation of INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void OnPropertyChanged<T>(object sender, Expression<Func<T>> property)
        {
            PropertyHelper.OnPropertyChanged(sender, PropertyChanged, property);
        }
    }
}